package com.xxx.meter.model.utils;

import android.view.Gravity;
import android.widget.Toast;

import com.xxx.meter.app.App;

/**
 * Toast工具类
 */
public class ToastUtil {

    public static void showToast(String s) {
        if (s == null || s.equals("")) return;
        Toast toast = Toast.makeText(App.getContext(), s, Toast.LENGTH_SHORT);
        toast.setGravity(Gravity.CENTER, 0, 0);
        toast.show();
    }

    public static void showToast(int resId) {
        showToast(App.getContext().getString(resId));
    }
}